package com.itheima.c05_api_lambda;


import java.util.Arrays;

public class Test { 
    public static void main(String[] args) {
        Student[] students = {
                new Student("张三", 180, 20),
                new Student("李四", 180, 18),
                new Student("王五", 180, 19)};

        Student ch=new Student();
        Arrays.sort(students,ch::compare);
      //  Arrays.sort(students, (o1, o2) -> o1.getAge() - o2.getAge());

        for (int i = 0; i < students.length; i++) {
            System.out.println(students[i]);
        }

    }
}
